package org.example.client;

import org.example.exception.ExceptionEnum;
import org.example.exception.ResultCode;
import org.example.exception.throwtype.RunException;
import org.example.vo.ScanVo;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;

/**
* @description: TODO
* @author 杨镇宇
* @date 2024/7/29 15:13
* @version 1.0
*/
@Component
public class SpringCloudServiceBClientFallback implements SpringCloudServiceBClient{
    //自定义的降级处理逻辑
    @Override
    public String scan(ScanVo scanVo) {

        ResultCode r = ExceptionEnum.FALLBACK_RESPONSE_ERROR;
        r.setDesc("---springCloudServiceB----" + HttpStatus.SERVICE_UNAVAILABLE.getReasonPhrase());
        throw  new RunException(r);
    }
}
